package org.example.bean;

import org.example.Animal;
import org.example.Feedable;

public class Elephant extends Animal implements Feedable {
    private String ears;

    public Elephant(String name, int age) {
        super(name, age);
    }

    public Elephant(String name, int age, String ears) {
        super(name, age);
        this.ears = ears;
    }

    public String getEars() {
        return ears;
    }

    public void setEars(String ears) {
        this.ears = ears;
    }

    @Override
    public void feed() {
        System.out.println("正在给大象喂食香蕉");
    }
    @Override
    public void makeSound(){
        System.out.println("大象发出呼噜声");
    }
    @Override
    public String toString() {
        return "动物姓名："+getName()+","+"动物年龄"+getAge()+","+"大象耳朵的大小："+getEars();
    }
}
